﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using HumanManagement.BusinessObjects;
using HumanManagement.DataAccess;

namespace HumanManagement.BusinessLogic
{
	public class EducationDegreeBL
	{

		#region ***** Init Methods ***** 
		EducationDegreeDA objEducationDegreeDA;
		public EducationDegreeBL()
		{
			objEducationDegreeDA = new EducationDegreeDA();
		}
		#endregion

		#region ***** Get Methods ***** 
		/// <summary>
		/// Get EducationDegree by id
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns>EducationDegree</returns>
		public EducationDegree GetByID(int id)
		{
			return objEducationDegreeDA.GetByID(id);
		}

		/// <summary>
		/// Get all of EducationDegree
		/// </summary>
		/// <returns>List<<EducationDegree>></returns>
		public List<EducationDegree> GetList()
		{
			string cacheName = "lstEducationDegree";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objEducationDegreeDA.GetList(), "EducationDegree");
			}
			return (List<EducationDegree>) ServerCache.Get(cacheName);
		}

		/// <summary>
		/// Get DataSet of EducationDegree
		/// </summary>
		/// <returns>DataSet</returns>
		public DataSet GetDataSet()
		{
			string cacheName = "dsEducationDegree";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objEducationDegreeDA.GetDataSet(), "EducationDegree");
			}
			return (DataSet) ServerCache.Get(cacheName);
		}


		/// <summary>
		/// Get all of EducationDegree paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>List<<EducationDegree>></returns>
		public List<EducationDegree> GetListPaged(int recperpage, int pageindex)
		{
			return objEducationDegreeDA.GetListPaged(recperpage, pageindex);
		}

		/// <summary>
		/// Get DataSet of EducationDegree paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>DataSet</returns>
		public DataSet GetDataSetPaged(int recperpage, int pageindex)
		{
			return objEducationDegreeDA.GetDataSetPaged(recperpage, pageindex);
		}





		#endregion

		#region ***** Add Update Delete Methods ***** 
		/// <summary>
		/// Add a new EducationDegree within EducationDegree database table
		/// </summary>
		/// <param name="obj_educationdegree">EducationDegree</param>
		/// <returns>key of table</returns>
		public int Add(EducationDegree obj_educationdegree)
		{
			ServerCache.Remove("EducationDegree", true);
			return objEducationDegreeDA.Add(obj_educationdegree);
		}

		/// <summary>
		/// updates the specified EducationDegree
		/// </summary>
		/// <param name="obj_educationdegree">EducationDegree</param>
		/// <returns></returns>
		public void Update(EducationDegree obj_educationdegree)
		{
			ServerCache.Remove("EducationDegree", true);
			objEducationDegreeDA.Update(obj_educationdegree);
		}

		/// <summary>
		/// Delete the specified EducationDegree
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns></returns>
		public void Delete(int id)
		{
			ServerCache.Remove("EducationDegree", true);
			objEducationDegreeDA.Delete(id);
		}
		#endregion
	}
}
